#!/bin/sh
dir=.
[ "$1" != "" ] && dir=$1

tar tf f03.instctrl.tar | egrep '.inv$' | sed -e 's/.inv$//' | grep -n .

mkdir $dir $dir/usr $dir/usr/etc $dir/usr/etc $dir/usr/etc/subsets
(cd $dir/usr/etc/subsets ; tar xf - ) < f03.instctrl.tar

read line
for i in $line
do
    echo "extracting subset $i"

    j=`expr $i + 3`
    if [ $j -lt 10 ]
    then
	num="0$j"
    else
	num=$j
    fi

    name=f$num.tar.Z

    zcat $name | (cd $dir ; tar xf - )
done

